HAL DCMI types migration

This section provides information about the HAL DCMI types migration.

HAL DCMI callback type definition

HAL1

HAL2

typedef enum
{
  HAL_DCMI_ERROR_CB_ID,
  HAL_DCMI_FRAME_EVENT_CB_ID,
  HAL_DCMI_LINE_EVENT_CB_ID,
  HAL_DCMI_MSPDEINIT_CB_ID,
  HAL_DCMI_MSPINIT_CB_ID,
  HAL_DCMI_VSYNC_EVENT_CB_ID
} HAL_DCMI_CallbackIDTypeDef;
  • Removed from HAL2 : the callback registration is managed by dedicated functions for each dcmi event. For more details, refer to HAL DCMI register callback functions

  • HAL_DCMI_MSPINIT_CB_ID and HAL_DCMI_MSPDEINIT_CB_ID are removed because the functions HAL_DCMI_MspInit() and HAL_DCMI_MspDeInit() are removed.

Related concepts:


HAL DCMI state type definition

HAL1

HAL2

typedef enum
{
  HAL_DCMI_STATE_RESET,






  HAL_DCMI_STATE_READY,
  HAL_DCMI_STATE_BUSY,
  HAL_DCMI_STATE_SUSPENDED,



  HAL_DCMI_STATE_TIMEOUT,
  HAL_DCMI_STATE_ERROR
} HAL_DCMI_StateTypeDef;
typedef enum
{
  HAL_DCMI_STATE_RESET,
  HAL_DCMI_STATE_INIT,
  HAL_DCMI_STATE_CONFIGURED
} hal_dcmi_state_t;
typedef enum
{
  HAL_DCMI_PIPE_STATE_RESET,
  HAL_DCMI_PIPE_STATE_IDLE,
  HAL_DCMI_PIPE_STATE_ACTIVE,
  HAL_DCMI_PIPE_STATE_SUSPEND,
  HAL_DCMI_PIPE_STATE_ABORT
} hal_dcmi_pipe_state_t;

Related concept: Removal and conversion of init structure to configuration structure


HAL DCMI codes initialization type definition

HAL1

HAL2

typedef struct
{
  uint8_t FrameStartCode;
  uint8_t LineStartCode;
  uint8_t LineEndCode;
  uint8_t FrameEndCode;
} DCMI_CodesInitTypeDef
typedef struct
{
  uint8_t frame_start;
  uint8_t line_start;
  uint8_t line_end;
  uint8_t frame_end;
} hal_dcmi_parallel_emb_sync_config_t;

Related concept: Removal and conversion of init structure to configuration structure


HAL DCMI initialization type definition

HAL1

HAL2

typedef struct
{
  uint32_t JPEGMode;
  uint32_t  PCKPolarity;
  uint32_t  HSPolarity;
  uint32_t  VSPolarity;
  uint32_t  ExtendedDataMode;


  uint32_t  SynchroMode;
  uint32_t  CaptureRate;
  DCMI_CodesInitTypeDef SyncroCode;

  uint32_t ByteSelectMode;
  uint32_t ByteSelectStart;

  uint32_t LineSelectMode;
  uint32_t LineSelectStart;
} DCMI_InitTypeDef;
typedef struct
{
  hal_dcmi_format_t               format;
  hal_dcmi_pixel_clock_polarity_t pixel_polarity;
  hal_dcmi_hsync_polarity_t       hsync_polarity;
  hal_dcmi_vsync_polarity_t       vsync_polarity;
  hal_dcmi_extended_data_mode_t   data_width;
} hal_dcmi_parallel_config_t;

HAL_DCMI_PARALLEL_SetSyncMode(hal_dcmi_handle_t *hdcmi, hal_dcmi_sync_mode_t mode);
HAL_DCMI_SetConfigPipe(hal_dcmi_handle_t *hdcmi, hal_dcmi_pipe_t pipe, const hal_dcmi_pipe_config_t *p_config);
HAL_DCMI_PARALLEL_SetEmbSyncCode(hal_dcmi_handle_t *hdcmi, const hal_dcmi_parallel_emb_sync_config_t *p_config);

HAL_DCMI_SetPipeBytesDecimation(hal_dcmi_handle_t *hdcmi, hal_dcmi_pipe_t pipe,
                                hal_dcmi_byte_decimation_mode_t byte_decimation_mode);

HAL_DCMI_SetPipeLinesDecimation(hal_dcmi_handle_t *hdcmi, hal_dcmi_pipe_t pipe,
                                hal_dcmi_line_decimation_mode_t line_decimation_mode);

Related concepts:


HAL DCMI sync unmask type definition

HAL1

HAL2

typedef struct
{
  uint8_t FrameStartUnmask;
  uint8_t LineStartUnmask;
  uint8_t LineEndUnmask;
  uint8_t FrameEndUnmask;
} DCMI_SyncUnmaskTypeDef;
typedef struct
{
  uint8_t frame_start;
  uint8_t line_start;
  uint8_t line_end;
  uint8_t frame_end;
} hal_dcmi_parallel_emb_sync_config_t;

Related concepts:


HAL DCMI handle type definition

HAL1

HAL2

DCMI_HandleTypeDef
hal_dcmi_handle_t

Related concept: Removal and conversion of init structure to configuration structure


HAL DCMI callback type definition

HAL1

HAL2

pDCMI_CallbackTypeDef()
hal_dcmi_cb_t
hal_dcmi_pipe_cb_t

Related concept: Replaced TypeDef suffix with _t in type names